/*           Copyright(c) 2007-2008 Dave Sexton            *
 *                   XmlTreeView Control                   *
 * http://www.codeplex.com/DocProject/Project/License.aspx *
 ***********************************************************/
using System;
using System.Collections.Generic;
using System.Text;

namespace DaveSexton.Controls
{
	/// <summary>
	/// Provides event arguments for the <see cref="XmlTreeView"/> control.
	/// </summary>
	[Serializable]
	public class XmlTreeNodeCreatedEventArgs : XmlTreeNodeEventArgs
	{
		#region Public Properties
		public int Index
		{
			get
			{
				return index;
			}
		}
		#endregion

		#region Private / Protected
		private readonly int index;
		#endregion

		#region Constructors
		/// <summary>
		/// Constructs a new instance of the <see cref="XmlTreeNodeCreatedEventArgs" /> class.
		/// </summary>
		public XmlTreeNodeCreatedEventArgs(XmlTreeNode node, int index)
			: base(node)
		{
			if (index < -1)
				throw new ArgumentOutOfRangeException("index", (int) index, Resources.Errors.LessThanNegativeOne);

			this.index = index;
		}
		#endregion
	}
}
